<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libcoap: mem.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">libcoap<span id="projectnumber">&#160;4.2.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function() { init_codefold(0); });
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('mem_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="headertitle"><div class="title">mem.h</div></div>
</div><!--header-->
<div class="contents">
<a href="mem_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="comment">/*</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span><span class="comment"> * mem.h -- CoAP memory handling</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><span class="comment"> *</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span><span class="comment"> * Copyright (C) 2010-2011,2014-2015 Olaf Bergmann &lt;bergmann@tzi.org&gt;</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="comment"> *</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span><span class="comment"> * This file is part of the CoAP library libcoap. Please see README for terms</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span><span class="comment"> * of use.</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="comment"> */</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span> </div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="preprocessor">#ifndef COAP_MEM_H_</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span><span class="preprocessor">#define COAP_MEM_H_</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span> </div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span><span class="preprocessor">#include &lt;stdlib.h&gt;</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span> </div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="preprocessor">#ifndef WITH_LWIP</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"><a class="line" href="mem_8h.html#a65d0fc0fe6cad555b56e92ccb57613ba">   21</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="mem_8h.html#a65d0fc0fe6cad555b56e92ccb57613ba">coap_memory_init</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span><span class="preprocessor">#endif </span><span class="comment">/* WITH_LWIP */</span><span class="preprocessor"></span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span> </div>
<div class="foldopen" id="foldopen00029" data-start="{" data-end="};">
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"><a class="line" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620">   29</a></span><span class="keyword">typedef</span> <span class="keyword">enum</span> {</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"><a class="line" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620ac4b8bae3a94d882154fabe0957a3ab2e">   30</a></span>  <a class="code hl_enumvalue" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620ac4b8bae3a94d882154fabe0957a3ab2e">COAP_STRING</a>,</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"><a class="line" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620aa8a6d143ba39aca364b42f7c6bd4d618">   31</a></span>  <a class="code hl_enumvalue" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620aa8a6d143ba39aca364b42f7c6bd4d618">COAP_ATTRIBUTE_NAME</a>,</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"><a class="line" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a4baef278cf60f00d15b149914c0f1811">   32</a></span>  <a class="code hl_enumvalue" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a4baef278cf60f00d15b149914c0f1811">COAP_ATTRIBUTE_VALUE</a>,</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"><a class="line" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620ab4e8cb3171f267b830d97626ad7a8d69">   33</a></span>  <a class="code hl_enumvalue" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620ab4e8cb3171f267b830d97626ad7a8d69">COAP_PACKET</a>,</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"><a class="line" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a239e408c064f87c6e7cfa8b2d6442f9d">   34</a></span>  <a class="code hl_enumvalue" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a239e408c064f87c6e7cfa8b2d6442f9d">COAP_NODE</a>,</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"><a class="line" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a63028bf12af38811e0cb3ec7fe35e897">   35</a></span>  <a class="code hl_enumvalue" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a63028bf12af38811e0cb3ec7fe35e897">COAP_CONTEXT</a>,</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a58e4d720ad9177654baa457ab284510b">   36</a></span>  <a class="code hl_enumvalue" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a58e4d720ad9177654baa457ab284510b">COAP_ENDPOINT</a>,</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"><a class="line" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a7442ae365f092f7aa0e516e6d67e7740">   37</a></span>  <a class="code hl_enumvalue" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a7442ae365f092f7aa0e516e6d67e7740">COAP_PDU</a>,</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"><a class="line" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620ac7bb2f8183a3ed5a92a3e085b542f42f">   38</a></span>  <a class="code hl_enumvalue" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620ac7bb2f8183a3ed5a92a3e085b542f42f">COAP_PDU_BUF</a>,</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a3ed13177a838b75eb0c46d4f4dce85ac">   39</a></span>  <a class="code hl_enumvalue" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a3ed13177a838b75eb0c46d4f4dce85ac">COAP_RESOURCE</a>,</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a3ed3c7e549d893f00509f9e2f07249c0">   40</a></span>  <a class="code hl_enumvalue" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a3ed3c7e549d893f00509f9e2f07249c0">COAP_RESOURCEATTR</a>,</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span><span class="preprocessor">#ifdef HAVE_LIBTINYDTLS</span></div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno">   42</span>  COAP_DTLS_SESSION,</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"><a class="line" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a010f82674bff4f905896c7ff94252ce4">   44</a></span>  <a class="code hl_enumvalue" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a010f82674bff4f905896c7ff94252ce4">COAP_SESSION</a>,</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"><a class="line" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a72ef666492d28949f05ecadef120d4e4">   45</a></span>  <a class="code hl_enumvalue" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a72ef666492d28949f05ecadef120d4e4">COAP_OPTLIST</a>,</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span>} <a class="code hl_enumeration" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620">coap_memory_tag_t</a>;</div>
</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span> </div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno">   48</span><span class="preprocessor">#ifndef WITH_LWIP</span></div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno">   49</span> </div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"><a class="line" href="mem_8h.html#a9f9fd8d6cf24f9c45a5501aeba5acaf9">   60</a></span><span class="keywordtype">void</span> *<a class="code hl_function" href="mem_8h.html#a9f9fd8d6cf24f9c45a5501aeba5acaf9">coap_malloc_type</a>(<a class="code hl_enumeration" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620">coap_memory_tag_t</a> type, <span class="keywordtype">size_t</span> size);</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span> </div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"><a class="line" href="mem_8h.html#ae7214e0c73a4d4290525873e739ed422">   70</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="mem_8h.html#ae7214e0c73a4d4290525873e739ed422">coap_free_type</a>(<a class="code hl_enumeration" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620">coap_memory_tag_t</a> type, <span class="keywordtype">void</span> *p);</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno">   71</span> </div>
<div class="foldopen" id="foldopen00075" data-start="{" data-end="}">
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"><a class="line" href="mem_8h.html#a26f40acd710e6c964242c2e0cd789375">   75</a></span><a class="code hl_define" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> <span class="keywordtype">void</span> *<a class="code hl_function" href="mem_8h.html#a26f40acd710e6c964242c2e0cd789375">coap_malloc</a>(<span class="keywordtype">size_t</span> size) {</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno">   76</span>  <span class="keywordflow">return</span> <a class="code hl_function" href="mem_8h.html#a9f9fd8d6cf24f9c45a5501aeba5acaf9">coap_malloc_type</a>(<a class="code hl_enumvalue" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620ac4b8bae3a94d882154fabe0957a3ab2e">COAP_STRING</a>, size);</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno">   77</span>}</div>
</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno">   78</span> </div>
<div class="foldopen" id="foldopen00082" data-start="{" data-end="}">
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"><a class="line" href="mem_8h.html#a1e46a1505bb13f03fdacd5d1b32502a6">   82</a></span><a class="code hl_define" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> <span class="keywordtype">void</span> <a class="code hl_function" href="mem_8h.html#a1e46a1505bb13f03fdacd5d1b32502a6">coap_free</a>(<span class="keywordtype">void</span> *<span class="keywordtype">object</span>) {</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno">   83</span>  <a class="code hl_function" href="mem_8h.html#ae7214e0c73a4d4290525873e739ed422">coap_free_type</a>(<a class="code hl_enumvalue" href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620ac4b8bae3a94d882154fabe0957a3ab2e">COAP_STRING</a>, <span class="keywordtype">object</span>);</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno">   84</span>}</div>
</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno">   85</span> </div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno">   86</span><span class="preprocessor">#endif </span><span class="comment">/* not WITH_LWIP */</span><span class="preprocessor"></span></div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno">   87</span> </div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno">   88</span><span class="preprocessor">#ifdef WITH_LWIP</span></div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno">   89</span> </div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno">   90</span><span class="preprocessor">#include &lt;lwip/memp.h&gt;</span></div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno">   91</span> </div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno">   92</span><span class="comment">/* no initialization needed with lwip (or, more precisely: lwip must be</span></div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno">   93</span><span class="comment"> * completely initialized anyway by the time coap gets active)  */</span></div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno">   94</span><a class="code hl_define" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> <span class="keywordtype">void</span> <a class="code hl_function" href="mem_8h.html#a65d0fc0fe6cad555b56e92ccb57613ba">coap_memory_init</a>(<span class="keywordtype">void</span>) {}</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno">   95</span> </div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno">   96</span><span class="comment">/* It would be nice to check that size equals the size given at the memp</span></div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno">   97</span><span class="comment"> * declaration, but i currently don&#39;t see a standard way to check that without</span></div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno">   98</span><span class="comment"> * sourcing the custom memp pools and becoming dependent of its syntax</span></div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno">   99</span><span class="comment"> */</span></div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno">  100</span><span class="preprocessor">#define coap_malloc_type(type, size) memp_malloc(MEMP_ ## type)</span></div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno">  101</span><span class="preprocessor">#define coap_free_type(type, p) memp_free(MEMP_ ## type, p)</span></div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno">  102</span> </div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno">  103</span><span class="comment">/* Those are just here to make uri.c happy where string allocation has not been</span></div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno">  104</span><span class="comment"> * made conditional.</span></div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno">  105</span><span class="comment"> */</span></div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno">  106</span><a class="code hl_define" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> <span class="keywordtype">void</span> *<a class="code hl_function" href="mem_8h.html#a26f40acd710e6c964242c2e0cd789375">coap_malloc</a>(<span class="keywordtype">size_t</span> size) {</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno">  107</span>  LWIP_ASSERT(<span class="stringliteral">&quot;coap_malloc must not be used in lwIP&quot;</span>, 0);</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno">  108</span>}</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno">  109</span> </div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno">  110</span><a class="code hl_define" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> <span class="keywordtype">void</span> <a class="code hl_function" href="mem_8h.html#a1e46a1505bb13f03fdacd5d1b32502a6">coap_free</a>(<span class="keywordtype">void</span> *pointer) {</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno">  111</span>  LWIP_ASSERT(<span class="stringliteral">&quot;coap_free must not be used in lwIP&quot;</span>, 0);</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno">  112</span>}</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno">  113</span> </div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno">  114</span><span class="preprocessor">#endif </span><span class="comment">/* WITH_LWIP */</span><span class="preprocessor"></span></div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno">  115</span> </div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno">  116</span><span class="preprocessor">#endif </span><span class="comment">/* COAP_MEM_H_ */</span><span class="preprocessor"></span></div>
<div class="ttc" id="alibcoap_8h_html_a58b4446dccd0b8c21b3532ef6b77a57d"><div class="ttname"><a href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a></div><div class="ttdeci">#define COAP_STATIC_INLINE</div><div class="ttdef"><b>Definition</b> <a href="libcoap_8h_source.html#l00038">libcoap.h:38</a></div></div>
<div class="ttc" id="amem_8h_html_a1e46a1505bb13f03fdacd5d1b32502a6"><div class="ttname"><a href="mem_8h.html#a1e46a1505bb13f03fdacd5d1b32502a6">coap_free</a></div><div class="ttdeci">COAP_STATIC_INLINE void coap_free(void *object)</div><div class="ttdoc">Wrapper function to coap_free_type() for backwards compatibility.</div><div class="ttdef"><b>Definition</b> <a href="mem_8h_source.html#l00082">mem.h:82</a></div></div>
<div class="ttc" id="amem_8h_html_a26f40acd710e6c964242c2e0cd789375"><div class="ttname"><a href="mem_8h.html#a26f40acd710e6c964242c2e0cd789375">coap_malloc</a></div><div class="ttdeci">COAP_STATIC_INLINE void * coap_malloc(size_t size)</div><div class="ttdoc">Wrapper function to coap_malloc_type() for backwards compatibility.</div><div class="ttdef"><b>Definition</b> <a href="mem_8h_source.html#l00075">mem.h:75</a></div></div>
<div class="ttc" id="amem_8h_html_a65d0fc0fe6cad555b56e92ccb57613ba"><div class="ttname"><a href="mem_8h.html#a65d0fc0fe6cad555b56e92ccb57613ba">coap_memory_init</a></div><div class="ttdeci">void coap_memory_init(void)</div><div class="ttdoc">Initializes libcoap's memory management.</div></div>
<div class="ttc" id="amem_8h_html_a703fa791ab7a14ff983df73b15e9c620"><div class="ttname"><a href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620">coap_memory_tag_t</a></div><div class="ttdeci">coap_memory_tag_t</div><div class="ttdoc">Type specifiers for coap_malloc_type().</div><div class="ttdef"><b>Definition</b> <a href="mem_8h_source.html#l00029">mem.h:29</a></div></div>
<div class="ttc" id="amem_8h_html_a703fa791ab7a14ff983df73b15e9c620a010f82674bff4f905896c7ff94252ce4"><div class="ttname"><a href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a010f82674bff4f905896c7ff94252ce4">COAP_SESSION</a></div><div class="ttdeci">@ COAP_SESSION</div><div class="ttdef"><b>Definition</b> <a href="mem_8h_source.html#l00044">mem.h:44</a></div></div>
<div class="ttc" id="amem_8h_html_a703fa791ab7a14ff983df73b15e9c620a239e408c064f87c6e7cfa8b2d6442f9d"><div class="ttname"><a href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a239e408c064f87c6e7cfa8b2d6442f9d">COAP_NODE</a></div><div class="ttdeci">@ COAP_NODE</div><div class="ttdef"><b>Definition</b> <a href="mem_8h_source.html#l00034">mem.h:34</a></div></div>
<div class="ttc" id="amem_8h_html_a703fa791ab7a14ff983df73b15e9c620a3ed13177a838b75eb0c46d4f4dce85ac"><div class="ttname"><a href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a3ed13177a838b75eb0c46d4f4dce85ac">COAP_RESOURCE</a></div><div class="ttdeci">@ COAP_RESOURCE</div><div class="ttdef"><b>Definition</b> <a href="mem_8h_source.html#l00039">mem.h:39</a></div></div>
<div class="ttc" id="amem_8h_html_a703fa791ab7a14ff983df73b15e9c620a3ed3c7e549d893f00509f9e2f07249c0"><div class="ttname"><a href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a3ed3c7e549d893f00509f9e2f07249c0">COAP_RESOURCEATTR</a></div><div class="ttdeci">@ COAP_RESOURCEATTR</div><div class="ttdef"><b>Definition</b> <a href="mem_8h_source.html#l00040">mem.h:40</a></div></div>
<div class="ttc" id="amem_8h_html_a703fa791ab7a14ff983df73b15e9c620a4baef278cf60f00d15b149914c0f1811"><div class="ttname"><a href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a4baef278cf60f00d15b149914c0f1811">COAP_ATTRIBUTE_VALUE</a></div><div class="ttdeci">@ COAP_ATTRIBUTE_VALUE</div><div class="ttdef"><b>Definition</b> <a href="mem_8h_source.html#l00032">mem.h:32</a></div></div>
<div class="ttc" id="amem_8h_html_a703fa791ab7a14ff983df73b15e9c620a58e4d720ad9177654baa457ab284510b"><div class="ttname"><a href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a58e4d720ad9177654baa457ab284510b">COAP_ENDPOINT</a></div><div class="ttdeci">@ COAP_ENDPOINT</div><div class="ttdef"><b>Definition</b> <a href="mem_8h_source.html#l00036">mem.h:36</a></div></div>
<div class="ttc" id="amem_8h_html_a703fa791ab7a14ff983df73b15e9c620a63028bf12af38811e0cb3ec7fe35e897"><div class="ttname"><a href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a63028bf12af38811e0cb3ec7fe35e897">COAP_CONTEXT</a></div><div class="ttdeci">@ COAP_CONTEXT</div><div class="ttdef"><b>Definition</b> <a href="mem_8h_source.html#l00035">mem.h:35</a></div></div>
<div class="ttc" id="amem_8h_html_a703fa791ab7a14ff983df73b15e9c620a72ef666492d28949f05ecadef120d4e4"><div class="ttname"><a href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a72ef666492d28949f05ecadef120d4e4">COAP_OPTLIST</a></div><div class="ttdeci">@ COAP_OPTLIST</div><div class="ttdef"><b>Definition</b> <a href="mem_8h_source.html#l00045">mem.h:45</a></div></div>
<div class="ttc" id="amem_8h_html_a703fa791ab7a14ff983df73b15e9c620a7442ae365f092f7aa0e516e6d67e7740"><div class="ttname"><a href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620a7442ae365f092f7aa0e516e6d67e7740">COAP_PDU</a></div><div class="ttdeci">@ COAP_PDU</div><div class="ttdef"><b>Definition</b> <a href="mem_8h_source.html#l00037">mem.h:37</a></div></div>
<div class="ttc" id="amem_8h_html_a703fa791ab7a14ff983df73b15e9c620aa8a6d143ba39aca364b42f7c6bd4d618"><div class="ttname"><a href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620aa8a6d143ba39aca364b42f7c6bd4d618">COAP_ATTRIBUTE_NAME</a></div><div class="ttdeci">@ COAP_ATTRIBUTE_NAME</div><div class="ttdef"><b>Definition</b> <a href="mem_8h_source.html#l00031">mem.h:31</a></div></div>
<div class="ttc" id="amem_8h_html_a703fa791ab7a14ff983df73b15e9c620ab4e8cb3171f267b830d97626ad7a8d69"><div class="ttname"><a href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620ab4e8cb3171f267b830d97626ad7a8d69">COAP_PACKET</a></div><div class="ttdeci">@ COAP_PACKET</div><div class="ttdef"><b>Definition</b> <a href="mem_8h_source.html#l00033">mem.h:33</a></div></div>
<div class="ttc" id="amem_8h_html_a703fa791ab7a14ff983df73b15e9c620ac4b8bae3a94d882154fabe0957a3ab2e"><div class="ttname"><a href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620ac4b8bae3a94d882154fabe0957a3ab2e">COAP_STRING</a></div><div class="ttdeci">@ COAP_STRING</div><div class="ttdef"><b>Definition</b> <a href="mem_8h_source.html#l00030">mem.h:30</a></div></div>
<div class="ttc" id="amem_8h_html_a703fa791ab7a14ff983df73b15e9c620ac7bb2f8183a3ed5a92a3e085b542f42f"><div class="ttname"><a href="mem_8h.html#a703fa791ab7a14ff983df73b15e9c620ac7bb2f8183a3ed5a92a3e085b542f42f">COAP_PDU_BUF</a></div><div class="ttdeci">@ COAP_PDU_BUF</div><div class="ttdef"><b>Definition</b> <a href="mem_8h_source.html#l00038">mem.h:38</a></div></div>
<div class="ttc" id="amem_8h_html_a9f9fd8d6cf24f9c45a5501aeba5acaf9"><div class="ttname"><a href="mem_8h.html#a9f9fd8d6cf24f9c45a5501aeba5acaf9">coap_malloc_type</a></div><div class="ttdeci">void * coap_malloc_type(coap_memory_tag_t type, size_t size)</div><div class="ttdoc">Allocates a chunk of size bytes and returns a pointer to the newly allocated memory.</div></div>
<div class="ttc" id="amem_8h_html_ae7214e0c73a4d4290525873e739ed422"><div class="ttname"><a href="mem_8h.html#ae7214e0c73a4d4290525873e739ed422">coap_free_type</a></div><div class="ttdeci">void coap_free_type(coap_memory_tag_t type, void *p)</div><div class="ttdoc">Releases the memory that was allocated by coap_malloc_type().</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_a14d23a24002734ac2a3b997119f008e.html">coap2</a></li><li class="navelem"><a class="el" href="mem_8h.html">mem.h</a></li>
    <li class="footer">Generated on Fri Dec 27 2024 09:57:44 for libcoap by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8 </li>
  </ul>
</div>
</body>
</html>
